<script type="text/javascript" src="<?php echo base_url() ?>public/tiny_mce/jscripts/tiny_mce/tiny_mce.js"></script>
<link href="<?php echo base_url(); ?>public/css/documentosGenerales" rel="stylesheet" type="text/css"/>

<style>
.botones{
	
	font-size: 10px;
}

#numero_pagina{
	
	background-color: #ccc;
	width: 18px;

}

.lineaVar{
	
	background-color: #ccc;
}

</style>

<script type="text/javascript">

   function setValue(value) {
	   
		top.tinyMCE.execCommand('mceInsertContent',false, value);
		top.tb_remove();
	}
	
   	$(document).ready(function(){
		
     	  $("#nombre, #direccion, #numero, #sector, #provincia, #objeto, #capital, #capitaletras, #cCuotas, #cCuotasLetras, #valorCuotas, #valorCuotasLetras, #dia, #mes, #anio, #Fecha, #Miembros, #NombreMiembro, #nacionalidad, #estadoc, #cedula, #domicilio, #cuotasSocio, #valorCuotasS, #totalCuotasS, #totalValorP, #descripcionM, #diaNumero, #mesNumero, #anioNumero, #nombreGerente, #cierreEstatutos, #firmaGeneral, #presideAsamblea, #calidaPresideAsam, #listadoGerente, #calle, #fechaCierre, #listadoMiembro, #tipoFirma").click(function(){

  	    	setValue($(this).val());
	   });

		 //Validar que el editor de texto no este vacio!
		 $("#botonSubmit").click(function(){
		    	 
		    	   var StrFejl = "";

				   tinyMCE.execCommand("mceCleanup");
				   tinyMCE.triggerSave();
				   
				   if (tinyMCE.getContent() == "" || tinyMCE.getContent() == null){
					   
					   tinyMCE.activeEditor.windowManager.alert('Prueba');
				   }
				   
				   if (StrFejl == "") {

			    	   tinyMCE.activeEditor.windowManager.alert('Prueba');
				       document.forms["post"].submit();
						
				       
				   }else {
					   		
				       alert(StrFejl);
				   }
				     		   
			});   
		 
	});

</script>

<script type="text/javascript">
	
tinyMCE.init({
	
	 mode : "textareas",
     theme : "advanced",
     plugins : "lists,style,layer,table,save,preview,searchreplace,print,paste,directionality,fullscreen",

     // Theme options
     theme_advanced_buttons1 : "save,code,print,|,bold,italic,underline,strikethrough,|,styleprops,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
     theme_advanced_buttons2 : "bullist,numlist,|,undo,redo,|,preview,|,forecolor,backcolor,|,tablecontrols,|,hr,removeformat",
     theme_advanced_toolbar_location : "top",
     theme_advanced_toolbar_align : "left",
     theme_advanced_statusbar_location : "bottom",
     theme_advanced_resizing : false

           
});

</script>

<div id="titulo">Editar Contenido Documento</div>
<?php echo form_open_multipart('documentosestatuspagina/save', array('name' => 'documentosestatuspagina','id' => 'commentForm'));?>
<form>
	<table class="tablaform" width="100%" border="0">
				
		<tr>
			<td><b>N&uacute;mero P&aacute;gina:</b> </td>
			<td><input type="text" name="numero_pagina" id="numero_pagina" size = "2" value="<?php echo $registros->getNumero_pagina();?>" readonly="readonly"/></td>
		</tr>
		
		<input type = "hidden" name = "tipo_documento" id = "tipo_documento" value = "<?php echo $tituloDoc;?>"/>
		
		<tr><td colspan = "2" class = "lineaVar">
		    <button type = "button" id = "nombre" value = "#Nombre_Compania#" class = "botones">Nombre Compa&ntilde;&iacute;a</button>
		    <button type = "button" id = "direccion" value = "#Direccion#" class = "botones">Direcci&oacute;n</button>
		    <button type = "button" id = "numero" value = "#No#" class = "botones">N&uacute;mero</button>
		    <button type = "button" id = "sector" value = "#Sector#" class = "botones">Sector</button>
		    <button type = "button" id = "provincia" value = "#Provincia#" class = "botones">Provincia</button>
		    <button type = "button" id = "calle"  value = "#calle#" class = "botones">Calle</button>
		    <button type = "button" id = "objeto" value = "#Objeto#" class = "botones">Objeto</buttcedulaon>
		    <button type = "button" id = "capital" value = "#Capital#" class = "botones">Capital</button>
		    <button type = "button" id = "capitaletras" value = "#CapitalLetras#" class = "botones">Capital Letras</button>
		    <button type = "button" id = "cCuotas" value = "#Cantidad_Cuotas#" class = "botones">Cantidad Cuotas</button>
		    <button type = "button" id = "cCuotasLetras" value = "#Cantidad_Cuotas_letras#" class = "botones">Cantidad Cuotas Letras</button>
		    <button type = "button" id = "valorCuotas" value = "#Valor_Cuotas#" class = "botones">Valor Cuotas</>
		    <button type = "button" id = "valorCuotasLetras" value = "#Valor_Cuotas_Letras#" class = "botones">Valor Cuotas Letras</>
		    <button type = "button" id = "Fecha" value = "#Fecha#" class = "botones">Fecha</button>
		    <button type = "button" id = "dia" value = "#dia#" class = "botones">D&iacute;a</button>
		    <button type = "button" id = "mes" value = "#Mes#" class = "botones">Mes</button>
		    <button type = "button" id = "anio" value = "#Anio#" class = "botones">A&ntilde;o</button>
		    <button type = "button" id = "diaNumero" value = "#diaNumero#" class = "botones">D&iacute;a Num</button>
		    <button type = "button" id = "mesNumero" value = "#MesNumero#" class = "botones">Mes Num</button>
		    <button type = "button" id = "anioNumero" value = "#AnioNumero#" class = "botones">A&ntilde;o Num</button>
		    <button type = "button" id = "Miembros" value = "#Miembros#" class = "botones">Miebros</button>
		    <button type = "button" id = "NombreMiembro" value = "#NombreMiembro#" class = "botones">Nombre Miembro</button>
		    <button type = "button" id = "nacionalidad" value = "#Nacionalidad#" class = "botones">Nacionalidad</button>
		    <button type = "button" id = "estadoc" value = "#estadoC#" class = "botones">E. Civil</button>
		    <button type = "button" id = "cedula" value = "#Cedula#" class = "botones">C&eacute;dula</button>
		    <button type = "button" id = "domicilio" value = "#domicilio#" class = "botones">Domicilio</button>
		    <button type = "button" id = "cuotasSocio" value = "#cuotasSocio#" class = "botones">Cuotas Socios</button>
		    <button type = "button" id = "valorCuotasS" value = "#valorCuotasS#" class = "botones">Valor Cuotas Socios</button>
		    <button type = "button" id = "totalCuotasS" value = "#totalCuotasS#" class = "botones">Total Cuotas</button>
		    <button type = "button" id = "totalValorP" value = "#totalValorP#" class = "botones">Total Valor pagado</button>
		    <button type = "button" id = "descripcionM" value = "#DescripcionMiembro#" class = "botones">Descripci&oacute;n Miembros</button>
		    <button type = "button" id = "listadoGerente" value = "#listadoGerente#" class = "botones">Listado Gerentes</button>
		    <button type = "button" id = "presideAsamblea" value = "#PresideAsamblea#" class = "botones">Preside Asamblea</button>
		    <button type = "button" id = "calidaPresideAsam" value = "#calidadPresideA#" class = "botones">Calidad Preside Asam</button>
		    <button type = "button" id = "nombreGerente" value = "#Nombres_Gerente#" class = "botones">Nombres Gerentes</button>
		    <button type = "button" id = "cierreEstatutos" value = "#cierre#" class = "botones">Cierre Estatutos</button>
		    <button type = "button" id = "firmaGeneral" value = "#firmaGemeral#" class = "botones">Firma Todos</button>
		    <button type = "button" id = "fechaCierre" value = "#fechaCierre#" class = "botones">Fecha Cierre</button>
		    <button type = "button" id = "listadoMiembro" value = "#listadoMiembro#" class = "botones">Listado Miembros</button>
		    <button type = "button" id = "tipoFirma" value = "#tipo_firma#" class = "botones">Tipo de Firma</button>
		    </td>
		 </tr>

		<tr>
			<td></td>
			<td><textarea class = "nombres" style = "width:612px; height:792px;" name="contenido" class="required" id="contenido"><div style = "clear: both;"><?php echo html_entity_decode($registros->getContenido_pagina());?></div></textarea></td>
		</tr>
		
		<input type = "hidden" name = "id_pagina" id = "id_pagina" value = "<?php echo $registros->getId_pagina();?>">

     	<tr><td colspan="2"><hr/></td></tr>
     	
     	<span hidden = "hidden" class = "presideA"><input type = "radio" name = "presideAsamblea" id = "presideAsamblea" class = "radioAsam" value = "1" checked = "checked"></span>		
     	
		<tr><td><input type="submit" value="Guardar" id = "botonSubmit" /></td>
		 <td><a href="<?php echo site_url().'/documentosestatuspagina' ?>"><input type="button" value="Atras" align="center"/></a></td>
		</tr>
	</table>
</form>


